﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ShopeeSdk.Response.Shopee.Item
{
    public class ItemAddResponse : ShopeeResponse
    {
        [JsonProperty("item_id")]
        public int ItemId { get; set; }

        [JsonProperty("item")]
        public ItemInfo Item { get; set; }


        public class ItemInfo
        {
            [JsonProperty("logistics")]
            public List<Logistic> Logistics { get; set; }

            [JsonProperty("original_price")]
            public float OriginalPrice { get; set; }

            [JsonProperty("package_width")]
            public float PackageWidth { get; set; }

            [JsonProperty("cmt_count")]
            public int CmtCount { get; set; }

            [JsonProperty("weight")]
            public float Weight { get; set; }

            [JsonProperty("shopid")]
            public int ShopId { get; set; }

            [JsonProperty("currency")]
            public string Currency { get; set; }

            [JsonProperty("create_time")]
            public int CreateTime { get; set; }

            [JsonProperty("likes")]
            public int Likes { get; set; }

            [JsonProperty("images")]
            public List<string> Images { get; set; }

            [JsonProperty("days_to_ship")]
            public int DaysToShip { get; set; }

            [JsonProperty("package_length")]
            public float PackageLength { get; set; }

            [JsonProperty("stock")]
            public int Stock { get; set; }

            [JsonProperty("status")]
            public string Status { get; set; }

            [JsonProperty("update_time")]
            public int UpdateTime { get; set; }

            [JsonProperty("description")]
            public string Description { get; set; }

            [JsonProperty("views")]
            public int Views { get; set; }

            [JsonProperty("price")]
            public float Price { get; set; }

            [JsonProperty("sales")]
            public int Sales { get; set; }

            [JsonProperty("wholesales")]
            public List<Wholesale> Wholesales { get; set; }

            [JsonProperty("condition")]
            public string Condition { get; set; }

            [JsonProperty("package_height")]
            public float PackageHeight { get; set; }

            [JsonProperty("name")]
            public string Name { get; set; }

            [JsonProperty("rating_star")]
            public float RatingStar { get; set; }

            [JsonProperty("item_sku")]
            public string ItemSku { get; set; }

            [JsonProperty("variations")]
            public List<Variation> Variations { get; set; }

            [JsonProperty("size_chart")]
            public string SizeChart { get; set; }

            [JsonProperty("has_variation")]
            public bool HasVariation { get; set; }

            [JsonProperty("attributes")]
            public List<Attribute> Attributes { get; set; }

            [JsonProperty("category_id")]
            public int CategoryId { get; set; }
        }

        public class Logistic
        {
            [JsonProperty("logistic_name")]
            public string LogisticName { get; set; }

            [JsonProperty("is_free")]
            public bool IsFree { get; set; }

            [JsonProperty("estimated_shipping_fee")]
            public float EstimatedShippingFee { get; set; }

            [JsonProperty("logistic_id")]
            public int LogisticId { get; set; }

            [JsonProperty("enabled")]
            public bool Enabled { get; set; }
        }

        public class Attribute
        {
            [JsonProperty("attribute_name")]
            public string AttributeName { get; set; }

            [JsonProperty("is_mandatory")]
            public bool IsMandatory { get; set; }

            [JsonProperty("attribute_id")]
            public int AttributeId { get; set; }

            [JsonProperty("attribute_value")]
            public string AttributeValue { get; set; }

            [JsonProperty("attribute_type")]
            public string AttributeType { get; set; }
        }

        public class Wholesale
        {
            [JsonProperty("min")]
            public int Min { get; set; }

            [JsonProperty("max")]
            public int Max { get; set; }

            [JsonProperty("unit_price")]
            public float UnitPrice { get; set; }
        }

        public class Variation
        {

            [JsonProperty("name")]
            public string Name { get; set; }

            [JsonProperty("stock")]
            public int Stock { get; set; }

            [JsonProperty("price")]
            public float Price { get; set; }

            [JsonProperty("variation_sku")]
            public string VariationSku { get; set; }
        }
    }


}
